/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ProtobufCustomizerPanel.java
 *
 * Created on 2009-08-16, 13:32:00
 */
package pl.waw.tabor.netbeans.protobuf.generator.customizer;

import pl.waw.tabor.netbeans.protobuf.generator.ProtobufGeneratorConfig;

/**
 *
 * @author ptab
 */
public class ProtobufCustomizerPanel extends javax.swing.JPanel {

  /** Creates new form ProtobufCustomizerPanel */
  public ProtobufCustomizerPanel() {
    initComponents();
  }

  public void setConfig(ProtobufGeneratorConfig pgc) {
    generateCPPCheckbox.setSelected(pgc.isCpp_gen());
    generateJavaCheckbox.setSelected(pgc.isJava_gen());
    generatePythonCheckbox.setSelected(pgc.isPython_gen());
  }

  public ProtobufGeneratorConfig getConfig() {
    ProtobufGeneratorConfig pgc = new ProtobufGeneratorConfig();
    pgc.setCpp_gen(generateCPPCheckbox.isSelected());
    pgc.setJava_gen(generateJavaCheckbox.isSelected());
    pgc.setPython_gen(generatePythonCheckbox.isSelected());
    return pgc;
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jSeparator1 = new javax.swing.JSeparator();
    jLabel1 = new javax.swing.JLabel();
    generateJavaCheckbox = new javax.swing.JCheckBox();
    generateCPPCheckbox = new javax.swing.JCheckBox();
    generatePythonCheckbox = new javax.swing.JCheckBox();

    jLabel1.setText(org.openide.util.NbBundle.getMessage(ProtobufCustomizerPanel.class, "ProtobufCustomizerPanel.jLabel1.text")); // NOI18N

    generateJavaCheckbox.setText(org.openide.util.NbBundle.getMessage(ProtobufCustomizerPanel.class, "ProtobufCustomizerPanel.protobufGenerateJavaCheckBox.text")); // NOI18N
    generateJavaCheckbox.setName("protobufGenerateJavaCheckBox"); // NOI18N
    generateJavaCheckbox.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        generateJavaCheckboxActionPerformed(evt);
      }
    });

    generateCPPCheckbox.setText(org.openide.util.NbBundle.getMessage(ProtobufCustomizerPanel.class, "ProtobufCustomizerPanel.protobufGenerateCppCheckBox.text")); // NOI18N
    generateCPPCheckbox.setName("protobufGenerateCppCheckBox"); // NOI18N
    generateCPPCheckbox.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        generateCPPCheckboxActionPerformed(evt);
      }
    });

    generatePythonCheckbox.setText(org.openide.util.NbBundle.getMessage(ProtobufCustomizerPanel.class, "ProtobufCustomizerPanel.protobufGeneratePythonCheckbox.text")); // NOI18N
    generatePythonCheckbox.setName("protobufGeneratePythonCheckbox"); // NOI18N
    generatePythonCheckbox.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        generatePythonCheckboxActionPerformed(evt);
      }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
          .addComponent(jLabel1)
          .addGroup(layout.createSequentialGroup()
            .addGap(12, 12, 12)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
              .addComponent(generateJavaCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(generateCPPCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addComponent(generatePythonCheckbox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        .addContainerGap())
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jLabel1)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(generateJavaCheckbox)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(generateCPPCheckbox)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(generatePythonCheckbox)
        .addGap(7, 7, 7)
        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(261, Short.MAX_VALUE))
    );
  }// </editor-fold>//GEN-END:initComponents

    private void generateJavaCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateJavaCheckboxActionPerformed
    }//GEN-LAST:event_generateJavaCheckboxActionPerformed

    private void generatePythonCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generatePythonCheckboxActionPerformed
    }//GEN-LAST:event_generatePythonCheckboxActionPerformed

    private void generateCPPCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateCPPCheckboxActionPerformed
    }//GEN-LAST:event_generateCPPCheckboxActionPerformed
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JCheckBox generateCPPCheckbox;
  private javax.swing.JCheckBox generateJavaCheckbox;
  private javax.swing.JCheckBox generatePythonCheckbox;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JSeparator jSeparator1;
  // End of variables declaration//GEN-END:variables
}
